﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_Popup.Master" CodeBehind="Stock_Popup.aspx.vb" Inherits="I_PORT.Stock_Popup" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
                var _source;
    // keep track of the popup div
    var _popup;

    function showConfirm(customerid) {
        this._source = customerid;
        this._popup = $find('ModalPopupExtender3'); 
        this._popup.show();  
    }
       function okClick(){
        //  find the confirm ModalPopup and hide it
       this._popup.hide();

        __doPostBack(this._source.name,'');
        
    }
    
    function cancelClick(){
        //  find the confirm ModalPopup and hide it
        this._popup.hide();
    }
    function checkNumber(e) {
        var keycode;

        if (window.event) keycode = window.event.keyCode; // ใช้ IE อ่ะ

        else if (e) keycode = e.which; // ใช้ Firefox เน่าะ

        if (((keycode > 47) && (keycode < 58)) || (keycode == 190) || (keycode == 46)) {
            return true;
        }
        return false;
    }
</script>
<asp:UpdatePanel ID="updatePanelStock" runat="server">
 <ContentTemplate>
   <table width="100%" border="0" cellpadding="0" cellspacing="0" >
      <tr>
        <td align="center" >
        
                                             <fieldset style="width:95%;"><legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                      แบบฟอร์มบันทึกข้อมูลสินค้า</legend>
                                              <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                              <tr>
                                                    <td align="right" style="width:220px;"><asp:Label ID="Label7" runat="server" SkinID="lbtxt" Text="Type :"></asp:Label>&nbsp;</td>
                                                    <td align="left">
                                                            <asp:RadioButtonList ID="radioType" runat="server" SkinID="raio" AutoPostBack="true" RepeatDirection="Horizontal">
                                                               <asp:ListItem Selected="True" Value="C">Color</asp:ListItem>
                                                               <asp:ListItem Value="M">Marker</asp:ListItem>
                                                               <asp:ListItem Value="A">Additive</asp:ListItem>
                                                            </asp:RadioButtonList>
                                                    </td>
                                                 </tr>
                                                 <tr id="rowColor" runat="server">
                                                    <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label6" runat="server" SkinID="lbtxt" Text="Color :"></asp:Label>&nbsp;</td>
                                                    <td align="left">
                                                                  <asp:DropDownList ID="ddlColor" runat="server" SkinID="ddl">
                                                                  </asp:DropDownList>&nbsp;<asp:Label ID="labelxx" runat="server" Text="*" ForeColor="Red" ></asp:Label>
                                                    </td>
                                                 </tr>
                                                 <tr>
                                                    <td align="right" style="width:220px;"><asp:Label ID="Labelpd" runat="server" SkinID="lbtxt" Text="Grade :"></asp:Label>&nbsp;</td>
                                                    <td align="left"><asp:TextBox ID="txtGrade" runat="server" Width="200px" ></asp:TextBox>&nbsp;<asp:Label ID="label9" runat="server" Text="*" ForeColor="Red" ></asp:Label></td>
                                                 </tr>
                                                 <tr>
                                                    <td align="right" style="width:220px;"><asp:Label ID="Label8" runat="server" SkinID="lbtxt" Text="Brand :"></asp:Label>&nbsp;</td>
                                                    <td align="left"><asp:TextBox ID="txtBrand" runat="server" Width="250px" ></asp:TextBox>&nbsp;<asp:Label ID="label10" runat="server" Text="*" ForeColor="Red" ></asp:Label></td>
                                                 </tr>
                                                 <tr>
                                                    <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label2" runat="server" SkinID="lbtxt" Text="Description :"></asp:Label>&nbsp;</td>
                                                    <td align="left"><asp:TextBox ID="txtDescription" TextMode="MultiLine" Height="60px" Width="90%" runat="server" ></asp:TextBox></td>
                                                 </tr>
                                                 </table>
                                                 <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                 <tr>
                                                    <td colspan="2" >
                                                       <fieldset> <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                            ความเข้มข้น</legend>
                                                          <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                             <tr>
                                                               <td align="center" colspan="2">
                                                               <asp:GridView ID="gridProductPoint" runat="server" SkinID="gridblueNoPage" DataKeyNames="Product_no,Product_name,Group_no,Color_Point,Marker_Point"
                     AutoGenerateColumns="False">
                     <Columns>
                         <asp:BoundField HeaderText="Product" DataField="Product_name" />
                         <asp:BoundField HeaderText="ความเข้มข้น" DataField="Color_Point" />
                         <asp:TemplateField HeaderText="แก้ไข" ItemStyle-Width="50px">
                             <ItemTemplate>
                                 <asp:ImageButton ID="imgedit" CommandName="cmdedit" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" ImageUrl="~/Image/edit-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px">
                            <ItemTemplate>
                                 <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showConfirm(this); return false;"  runat="server" ImageUrl="~/Image/cancel-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
             </asp:GridView>
                                                               </td>
                                                             </tr>
                                                             <tr>
                                                               <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label4" runat="server" SkinID="lbtxt" Text="Group Product :"></asp:Label>&nbsp;</td>
                                                               <td align="left">
                                                                  <asp:DropDownList ID="ddlGroup" runat="server" SkinID="ddl" AutoPostBack="true" >
                                                                  </asp:DropDownList>
                                                               </td>
                                                            </tr>
                                                            <tr>
                                                               <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label5" runat="server" SkinID="lbtxt" Text="Product :"></asp:Label>&nbsp;</td>
                                                               <td align="left">
                                                                  <asp:DropDownList ID="ddlProduct" runat="server" SkinID="ddl">
                                                                  </asp:DropDownList>
                                                               </td>
                                                            </tr>
                                                             <tr>
                                                               <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label1" runat="server" SkinID="lbtxt" Text="ความเข้มข้น :"></asp:Label>&nbsp;</td>
                                                               <td align="left"><asp:TextBox ID="txtPoint" runat="server" Width="80px" onkeypress="return checkNumber(this);" ></asp:TextBox>&nbsp;<asp:Label ID="Label3" runat="server" SkinID="lbtxt" Text="PPM"></asp:Label></td>
                                                            </tr>
                                                            <tr id="rowmaker" runat="server" visible="false">
                                                               <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label11" runat="server" SkinID="lbtxt" Text="ตัวคูณในกรณีเติมเพิ่ม :"></asp:Label>&nbsp;</td>
                                                               <td align="left"><asp:TextBox ID="txtCompute" runat="server" Width="80px" Text="1" onkeypress="return checkNumber(this);" ></asp:TextBox></td>
                                                            </tr>
                                                             <tr>
                                                               <td align="right" valign="top" style="width:220px;">&nbsp;</td>
                                                               <td align="left">
                                                                  <asp:Button ID="btnSavePoint" runat="server" CssClass="ButtonStyle" Text="บันทึกความเข้มข้น" Width="140px" />
                                                                  <asp:Button ID="btnClear" runat="server" CssClass="ButtonStyle" Text="เคลียร์" />
                                                               </td>
                                                            </tr>
                                                          </table>
                                                       </fieldset>
                                                    </td>
                                                 </tr>
                                                 <tr>
                                                   <td colspan="2" align="right">
                                                     <asp:Button ID="btnSave" runat="server" CssClass="ButtonStyle" Text="บันทึก" Width="140px" />
                                                     <asp:Button ID="btnClose" runat="server" CssClass="ButtonStyle" Text="ปิด"  />
                                                   </td>
                                                 </tr>
                                              </table>
                                              </fieldset>
          </td>
      </tr>
   </table>
                                              <asp:Button ID="BtnTrigger" runat="server" style="display:none;" />
            <asp:ModalPopupExtender ID="ModalPopupExtender3" BehaviorID="ModalPopupExtender3" runat="server" 
                                    OkControlID="ctl00_contentplaceholder1_ConfirmDelete_btnOk" 
                                    OnOkScript="okClick();" 
                                    CancelControlID="ctl00_contentplaceholder1_ConfirmDelete_btnNo"     
                                    OnCancelScript="cancelClick();" 
                                     BackgroundCssClass="Background" 
                                      PopupControlID="PanelConfirm" TargetControlID="BtnTrigger" 
                                        DynamicServicePath="" Enabled="True" >
        </asp:ModalPopupExtender>
        <asp:Panel ID="PanelConfirm" runat="server" style="display:none;">
       <Confirm:Confirm1 ID="ConfirmDelete" runat="server" ></Confirm:Confirm1>
    </asp:Panel>
                                               </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
